﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;

namespace MODASA.HojaDefinicionProducto
{
    public partial class HDPVentilacion : System.Web.UI.Page
    {

        DataTable HDP;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["HDP"] == null)
            {
                Page.Response.Redirect("HDPModelos.aspx");

            }  
        }

        protected void RBLDESINS_SelectedIndexChanged(object sender, EventArgs e)
        {
            HabilitarDesabiliratDesempañador(RBLDESINS.Text);
        }

        private void HabilitarDesabiliratDesempañador(string res) {

            if (res == "NO")
            {
                RBLDESTIP.Enabled = false;
                HLDESEMPA.Visible = false;

            }
            else if (res == "SI")
            {
                RBLDESTIP.Enabled = true;
                HLDESEMPA.Visible = true;
                HLDESEMPA.ImageUrl = "../images/Buses/ImgInt/Ventilacion/m_Desempañador.jpg";
                HLDESEMPA.NavigateUrl = "../images/Buses/ImgInt/Ventilacion/Desempañador.jpg";
            }
        }

        protected void RBLCALINS_SelectedIndexChanged(object sender, EventArgs e)
        {
            HabilitarDesabiliratCalefaccion(RBLCALINS.Text);
        }
        private void HabilitarDesabiliratCalefaccion(string res) {
            if (res == "NO")
            {
                HLCALEFACC.Visible = false;

                RBLCALTIP.Enabled = false;
                RBLCALCAN.Enabled = false;
            }
            else if (res == "SI")
            {
                HLCALEFACC.Visible = true;
                HLCALEFACC.ImageUrl = "../images/Buses/ImgInt/Ventilacion/m_CalefaccionG.jpg";
                HLCALEFACC.NavigateUrl = "../images/Buses/ImgInt/Ventilacion/CalefaccionG.jpg";

                RBLCALTIP.Enabled = true;
                RBLCALCAN.Enabled = true;
            }
        }

        protected void RBLAIRACOINS_SelectedIndexChanged(object sender, EventArgs e)
        {
            HabilitarDesabiliratAireAcondicionado(RBLAIRACOINS.Text);
        }
        private void HabilitarDesabiliratAireAcondicionado(string res) {
            if (res == "NO")
            {
                HLAIREACOND.Visible = false;

                RBAIRACO1N.Enabled = false;
                RBAIRACO1NSN.Enabled = false;
                RBLAIRACOMAR.Enabled = false;

                if (RBLAIRFORINS.Enabled == false)
                {
                   
                    RBLAIRFORINS.Enabled = true;
                    RBLAIRFORCAN.Enabled = true;
                }
            }
            else if (res == "SI")
            {
                HLAIREACOND.Visible = true;
                HLAIREACOND.ImageUrl = "../images/Buses/ImgInt/Ventilacion/m_AireAcondicionadoG.jpg";
                HLAIREACOND.NavigateUrl = "../images/Buses/ImgInt/Ventilacion/AireAcondicionadoG.jpg";
               
                RBAIRACO1N.Enabled = true;
                RBAIRACO1NSN.Enabled = true;
                RBLAIRACOMAR.Enabled = true;

                if (RBLAIRFORINS.Enabled == true){
                RBLAIRFORINS.Enabled = false;
                RBLAIRFORCAN.Enabled = false;
                }
            }
        
        }

        protected void RBLRENOVINS_SelectedIndexChanged(object sender, EventArgs e)
        {
            HabilitarDesabiliratRenovadoresAire(RBLRENOVINS.Text);
        }

        private void HabilitarDesabiliratRenovadoresAire(string res) {
            if (res == "NO")
            {
                HLRENOVAIRE.Visible = false;

                RBLRENOVCAN.Enabled = false;
            }
            else if (res=="SI") {

                HLRENOVAIRE.Visible = true;
                HLRENOVAIRE.ImageUrl = "../images/Buses/ImgInt/Ventilacion/m_RenovadorAire.jpg";
                HLRENOVAIRE.NavigateUrl = "../images/Buses/ImgInt/Ventilacion/RenovadorAire.jpg";

                RBLRENOVCAN.Enabled = true;
            }
        }

        protected void RBLAIRFORINS_SelectedIndexChanged(object sender, EventArgs e)
        {
            HabilitarDesabiliratAireForzado(RBLAIRFORINS.Text);
        }
        private void HabilitarDesabiliratAireForzado(string res) {
            if (res == "NO")
            {
                RBLAIRFORCAN.Enabled = false;
            }
            else {

                RBLAIRFORCAN.Enabled = true;
            }
        }

        protected void RBLSISCLIMINS_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarImgSistemaClima(RBLSISCLIMINS.Text);
        }

        private void CargarImgSistemaClima(string res) {

            if (res == "SI")
            {
                HLSISTEMCLIMA.Visible = true;
                HLSISTEMCLIMA.ImageUrl = "../images/Buses/ImgInt/Ventilacion/m_Calefaccion.jpg";
                HLSISTEMCLIMA.NavigateUrl = "../images/Buses/ImgInt/Ventilacion/Calefaccion.jpg";
            }
            else {
                HLSISTEMCLIMA.Visible = false;
            }
        
        }

    }
}